<?php
//ham xuat xep loai sao
$avatar_default = "http://i256.photobucket.com/albums/hh164/langtu_ocbu/ZiGo/ZiGo_zps0764e340.png";
function printStar($number,$top){
	$short = $number/2;
	$short = round($short);
	if($short>=0 && $short<9){
		echo "<span class='img_star star".$short." description top".$top."'>".$number." bình luận</span>";
	}elseif($short>9){
		echo "<span class='img_star star9 description top".$top."'>".$number." bình luận</span>";
	}else{
		echo "<span class='img_star star0 description top".$top."'>".$number." bình luận</span>";
	}
}
// get size array of image from url
function getSize($url){
	if ($info = @getimagesize($url)) {
		if($info[0]<$info[1])
			return $info[0];
		else
			return $info[1];
	} else {
		return 0;
	}
}
// get width of image from url
function getWidthImage($url){
	if ($info = @getimagesize($url)) {
		return $info[0];
	} else {
		return 0;
	}
}
// get height of image from url
function getHeightImage($url){
	if ($info = @getimagesize($url)) {
		return $info[1];
	} else {
		return 0;
	}
}
// get new position from edge
function getPos($edge,$min,$size){
	return ($edge - $min)*$size/(2*$min);
}
?>